from game import *

import math

def init(game):
    
    start = StaticBox((8.0, 14.0, 8.0))
    start.set_position((0.0, -7.0, 0.0))
    game.add_object(start)

    m1 = MovingPlatform(1000, (5.0, 0.3, 5.0))
    m1.set_position((0.0, -0.1, -6.5))
    m1.set_texture_name("p2")
    m1.set_linear_vel((0.0, 0.0, -2.0))
    game.add_timer("m1", 9.5, 0.0, m1.reverse)
    game.add_object(m1)

    m2 = MovingPlatform(1000, (5.0, 0.3, 5.0))
    m2.set_position((0.0, -0.1, -50.0))
    m2.set_texture_name("p2")
    m2.set_linear_vel((0.0, 0.0, 2.0))
    game.add_timer("m2", 9.5, 0.0, m2.reverse)
    game.add_object(m2)

    p1 = StaticBox((16.0, 10.0, 10.0))
    p1.set_position((0.0, -5.0, -57.5))
    game.add_object(p1)


    f1 = Platform(999999999, (5.0, 0.3, 5.0))
    f1.set_position((0.0, 0.0, -68.0))
    f1.set_texture_name("p2")
    game.add_object(f1)
    f1.set_angular_vel((0.0, 0.0, 0.1))

    f2 = Platform(999999999, (5.0, 0.3, 5.0))
    f2.set_position((0.0, 0.0, -75.0))
    f2.set_texture_name("p2")
    game.add_object(f2)
    f2.set_angular_vel((0.0, 0.0, -0.1))
    
    f3 = Platform(999999999, (5.0, 0.3, 5.0))
    f3.set_position((0.0, 0.0, -82.0))
    f3.set_texture_name("p2")
    game.add_object(f3)
    f3.set_angular_vel((0.0, 0.0, 0.1))
    
    f4 = Platform(999999999, (5.0, 0.3, 5.0))
    f4.set_position((0.0, 0.0, -89.0))
    f4.set_texture_name("p2")
    game.add_object(f4)
    f4.set_angular_vel((0.0, 0.0, -0.1))

    p2 = StaticBox((3.5, 0.1, 40.0))
    p2.set_position((0.0, 4.0, -120.0))
    game.add_object(p2)
    p2.set_angles((15.0, 0.0, 0.0))

    p3 = StaticBox((24.0, 20.0, 12.0))
    p3.set_position((7.0, -0.7769, -145.3))
    game.add_object(p3)

    freqs = numpy.arange(0.0, 3.0, 0.01)
    posx = numpy.arange(-1.5, 1.5, 0.01)
    posy = numpy.arange(20.0, 30.0, 0.01)
    posz = numpy.arange(-137.0, -130.0, 0.01)
    sizes = numpy.arange(0.2, 2.0, 0.01)
    dens = numpy.arange(10000, 50000, 1.0)
    texs = ["ball"]
    s1 = BallGenerator("s1", freqs, (posx, posy, posz), sizes, dens, texs)

    #game.set_start_pos((0.0, 15.0, -140))

    p4 = StaticBox((9.0, 0.1, 20.0))
    p4.set_position((14.5, 10.803, -130.0))
    game.add_object(p4)
    p4.set_angles((-10.0, 0.0, 0.0))

    p5 = StaticBox((9.0, 20.0, 9.0))
    p5.set_position((14.5, 2.58, -115.7))
    game.add_object(p5)

    r1 = Platform(1000, (3.5, 3.5, 30.0))
    r1.set_position((17.5, 12.0, -93))
    r1.set_angles((-10.0, 15.0, 0.0))
    r1.set_angular_vel((0.0, 0.0, 0.4))
    r1.set_texture_name("swirl")
    game.add_object(r1)
    
    r2 = Platform(1000, (3.5, 3.5, 30.0))
    r2.set_position((14.5, 11.0, -60))
    r2.set_angles((10.0, -15.0, 0.0))
    r2.set_angular_vel((0.0, 0.0, -0.4))
    r2.set_texture_name("swirl")
    game.add_object(r2)

    r3 = Platform(1000, (3.5, 3.5, 30.0))
    r3.set_position((15.5, 12.0, -25))
    r3.set_angles((-15.0, 15.0, 0.0))
    r3.set_angular_vel((0.0, 0.0, 0.8))
    r3.set_texture_name("swirl")
    game.add_object(r3)


    p6 = StaticBox((20.0, 5.0, 20.0))
    p6.set_position((14.5, 10.5, 5.0))
    game.add_object(p6)

    #game.set_start_pos((14.5, 20.0, 5.0))

    num = 12
    for i in range(num):
        b = Platform(0.1, (5.0, 0.4, 8.0))
        b.set_position((27.3 + i*(5.01), 12.8, 5.0))
        b.set_texture_name("ice")
        game.add_object(b)

    g = StaticBox((5.0, 0.5, 5.0))
    g.set_position((27.3 + num*(5.01) + 0.5, 12.8, 5.0))
    g.set_texture_name("goal")
    game.add_object(g)
